package ventureco.agent;

import java.awt.Point;
import java.util.ArrayList;

public class AgentImpl implements Agent {
	private int ID;
	private double c_range,s_range,velocity,height,battery,remaining_battery;
	private Point p = new Point();
	public static ArrayList<Agent> agents = new ArrayList<Agent>();
	
	public  int getAgentCount()
	{
		return agents.size();
		
	}
	
	public AgentImpl() {
		
	}
	
	
	@Override
	public void setID(int ID) {
		
		this.ID = ID;
	}

	@Override
	public int getID() {
		
		return this.ID;
	}
	
	@Override
	public double getCommunicationRange() {
		
		return this.c_range;
	}

	@Override
	public void setCommunicationRange(double c_range) {
		
		this.c_range = c_range;
	}

	@Override
	public double getSightRange() {
		
		return this.s_range;
	}

	@Override
	public void setSightRange(double s_range) {
		
		this.s_range = s_range;
	}

	@Override
	public double getMaxVelocity() {
		
		return this.velocity;
	}

	@Override
	public void setMaxVelocity(double velocity) {
		
		this.velocity = velocity;
	}

	@Override
	public double getMaxHeight() {
		
		return this.height;
	}

	@Override
	public void setMaxHeight(double height) {
		
		this.height = height;
	}

	@Override
	public Point getCurrentPosition() {
		
		return this.p;
	}

	@Override
	public void setCurrentPosition(Point p) {
		
		this.p = p;
	}

	@Override
	public double getBatteryTime() {
		
		return this.battery;
	}

	@Override
	public void setBatteryTime(double battery) {
		
		this.battery = battery;
	}

	@Override
	public double getRemainingBattery() {
		
		return this.remaining_battery;
	}

	@Override
	public void setRemainingBattery(double battery) {
		
		this.remaining_battery = battery;
	}
	
	@Override
	public void setList(Agent agent) {
		
		agent.setID(agents.size());
		agent.setRemainingBattery(battery);
		agents.add(agent);
	}
	
	@Override
	public ArrayList<Agent> getList() {
		
		return agents;
	}

	public void setX(int x)
	{
		p.x = x;
	}
	
	public void setY(int y)
	{
		p.y = y;
	}
	
	public void setX(double x)
	{
		p.x = (int) x;
	}
	public void setY(double y)
	{
		p.y = (int)y;
	}
	
	
	
	@Override
	public void setCurrentPosition(double x, double y) {
		p.x = (int) x;
		p.y = (int) y;
		
	}

	@Override
	public int getX() {
		// TODO Auto-generated method stub
		return p.x;
	}

	@Override
	public int getY() {
		// TODO Auto-generated method stub
		return p.y;
	}

}
